﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

using System.IO.IsolatedStorage;
using WCF_LESO.Entidad;
using System.Collections;
using System.Data;

namespace PhoneApp1
{
    public partial class pvListaDisciplinas : PhoneApplicationPage
    {
        public pvListaDisciplinas()
        {
            InitializeComponent();
        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            WCF_LESO.ServicePhoneClient proxy = new WCF_LESO.ServicePhoneClient();

            proxy.ListaDisciplinasCompleted += new EventHandler<WCF_LESO.ListaDisciplinasCompletedEventArgs>(proxy_ListaDisciplinasCompleted);
            proxy.ListaDisciplinasAsync();
        }

        protected void proxy_ListaDisciplinasCompleted(object sender, WCF_LESO.ListaDisciplinasCompletedEventArgs e)
        {
            if (e.Result.Count > 0)
            {
                List<WCF_LESO.Disciplina> lista = new List<WCF_LESO.Disciplina>();

                for (int i = 0; i < e.Result.Count; i++)
                {
                    WCF_LESO.Disciplina d = new WCF_LESO.Disciplina();
                    d._Id_Disciplina = e.Result[i]._Id_Disciplina;
                    d._Descripcion_Disciplina = e.Result[i]._Descripcion_Disciplina;
                    lista.Add(d);
                }

                lbDisciplinas.ItemsSource = lista;

            }
        }

        private void lbDisciplinas_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (lbDisciplinas.SelectedIndex)
            {
                case 1:

                    break;
            }
        }





    }
}